import { Pipe, PipeTransform } from '@angular/core';


/**
 * 将number类型转换的管道
 */
@Pipe({
  name: 'toW'
})
export class ToWPipe implements PipeTransform {

  transform(count: number, ...args: unknown[]): unknown {
    let unit = ""
    let num = ""
    if(count>=10000){
      unit = "万"
      num = (count/10000).toFixed(1)
    }
    else{
      return count
    }
    return num + unit
  }



}
